<%--
  Created by IntelliJ IDEA.
  User: Gao
  Date: 2022/9/24
  Time: 14:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <%@ include file="header.jsp"%>
</head>
<body>
    <h1>iPhone 14 Pro !!!  1元秒杀！！！</h1>

    <button   id="second_kill_btn" >秒杀点我</button>

</body>
<script  type="text/javascript" src="${pageContext.request.contextPath}/script/jquery/jquery-3.1.0.js"></script>
<script  type="text/javascript">
    $(function(){
        $("#second_kill_btn").click(function(){
            $.post(
                '/product/secondKill',
                {'productId':26},
                function(jsonResult) {
                    console.log(jsonResult);
                    if (jsonResult.ok) {
                        mylayer.okMsg(jsonResult.msg);
                    } else {
                        mylayer.errorMsg(jsonResult.msg);
                    }
                },
                'json'
            );
        })
    })
</script>
</html>
